<template>
<<<<<<< HEAD
<div style="background: darkgray">
  <div style="background: #44B6AE; width: 2032px;height:100px" >
    <h1 style="color: aliceblue;" >
      成裕生产管理系统
    </h1>
  </div>
=======
<div>
>>>>>>> origin/master
  <el-form :inline="true" :model="formInline" class="demo-form-inline">
    <el-form-item label="条码">
      <el-input v-model="formInline.mnumber" placeholder="条码"></el-input>
    </el-form-item>
    <el-form-item label="名称">
      <el-input v-model="formInline.mname" placeholder="名称"></el-input>
    </el-form-item>
    <el-form-item label="规格">
      <el-input v-model="formInline.texture" placeholder="规格"></el-input>
    </el-form-item>
    <el-form-item label="备注">
      <el-input v-model="formInline.remark" placeholder="备注"></el-input>
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="list">查询</el-button>
    </el-form-item>
  </el-form>
  <el-table
      :data="tableData"
      style="width: 100%"
      max-height="250">
    <el-table-column
        fixed
        prop="id"
        label="id"
        width="150">
    </el-table-column>
    <el-table-column
        prop="mname"
        label="名称"
        width="120">
    </el-table-column>
    <el-table-column
        prop="mnumber"
        label="条码"
        width="120">
    </el-table-column>
    <el-table-column
        prop="texture"
        label="规格"
        width="120">
    </el-table-column>
    <el-table-column
        prop="tname"
        label="所属分类"
        width="300">
    </el-table-column>
    <el-table-column
        prop="mincount"
        label="库存预警最小数量"
        width="120">
    </el-table-column>
    <el-table-column
        prop="price"
        label="单价"
        width="120">
    </el-table-column>
    <el-table-column
        prop="meanprice"
        label="加权平均价格"
        width="120">
    </el-table-column>
<el-table-column
        prop="kucun"
        label="库存"
        width="120">
    </el-table-column>
<el-table-column
        prop="mainunit"
        label="默认单位"
        width="120">
    </el-table-column>
<el-table-column
        prop="auxiliaryunit"
        label="辅助单位"
        width="120">
    </el-table-column>
<el-table-column
        prop="conversion"
        label="转换关系"
        width="120">
    </el-table-column>
<el-table-column
        prop="createtime"
        label="创建时间"
        width="120">
    </el-table-column>
<el-table-column
        prop="remark"
        label="备注"
        width="120">
    </el-table-column>
  </el-table>
  <el-pagination
      @current-change="toPage"
      :current-page="pageNum"
      :page-size="pageSize"
      layout="total, prev, pager, next"
      :total="total">
  </el-pagination>
</div>

</template>

<script>
export default {
  name: "MaterialView",
  data(){
    return{
      formInline:{

      },
      pageNum:1,
      pageSize:5,
      tableData:[],
      total:0,
    }
  },methods:{
    toPage(page){
      this.pageNum=page;
      this.list();
    },
    list(){
      this.axios.post("list?pageNum="+this.pageNum+"&pageSize="+this.pageSize,this.formInline).then(r=>{
        this.tableData=r.data.data.list;
        this.total=r.data.data.total;
      })
    }
  },created() {
    this.list();
  }
}
</script>

<style scoped>

</style>